{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "12 steps to Navier–Stokes\n",
    "======\n",
    "***"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Hello! Welcome to the **12 steps to Navier–Stokes**. This is a practical module that is used in the beginning of an interactive Computational Fluid Dynamics (CFD) course taught by [Prof. Lorena Barba](http://lorenabarba.com) since Spring 2009 at Boston University. The course assumes only basic programming knowledge (in any language) and of course some foundation in partial differential equations and fluid mechanics. The practical module was inspired by the ideas of Dr. Rio Yokota, who was a post-doc in Barba's lab, and has been refined by Prof. Barba and her students over several semesters teaching the course. The course is taught entirely using Python and students who don't know Python just learn as we work through the module.\n",
    "\n",
    "This [Jupyter notebook](https://jupyter-notebook.readthedocs.io/en/stable/) will lead you through the first step of programming your own Navier–Stokes solver in Python from the ground up.  We're going to dive right in.  Don't worry if you don't understand everything that's happening at first, we'll cover it in detail as we move forward and you can support your learning with the videos of [Prof. Barba's lectures on YouTube](http://www.youtube.com/playlist?list=PL30F4C5ABCE62CB61).\n",
    "\n",
    "For best results, after you follow this notebook, prepare your own code for Step 1, either as a Python script or in a clean Jupyter notebook.\n",
    "\n",
    "To execute this Notebook, we assume you have invoked the notebook server using: `jupyter notebook`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Remember: comments in python are denoted by the pound sign\n",
    "import numpy                       #here we load numpy\n",
    "from matplotlib import pyplot      #here we load matplotlib\n",
    "import time, sys                   #and load some utilities\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "#this makes matplotlib plots appear in the notebook (instead of a separate window)\n",
    "%matplotlib inline                  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now let's define a few variables; we want to define an evenly spaced grid of points within a spatial domain that is 2 units of length wide, i.e., $x_i\\in(0,2)$.  We'll define a variable `nx`, which will be the number of grid points we want and `dx` will be the distance between any pair of adjacent grid points.  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "nx = 41  # try changing this number from 41 to 81 and Run All ... what happens?\n",
    "dx = 2 / (nx-1)\n",
    "nt = 25    #nt is the number of timesteps we want to calculate\n",
    "dt = .025  #dt is the amount of time each timestep covers (delta t)\n",
    "c = 1      #assume wavespeed of c = 1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We also need to set up our initial conditions. The initial velocity $u_0$ is given as \n",
    "$u = 2$ in the interval $0.5 \\leq x \\leq 1$  and $u = 1$ everywhere else in $(0,2)$ (i.e., a hat function).\n",
    "\n",
    "Here, we use the function `ones()` defining a `numpy` array which is `nx` elements long with every value equal to 1."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 1. 1. 1.\n",
      " 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]\n"
     ]
    }
   ],
   "source": [
    "u = numpy.ones(nx)      #numpy function ones()\n",
    "u[int(.5 / dx):int(1 / dx + 1)] = 2  #setting u = 2 between 0.5 and 1 as per our I.C.s\n",
    "print(u)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now let's take a look at those initial conditions using a Matplotlib plot.  We've imported the `matplotlib` plotting library `pyplot` and the plotting function is called `plot`, so we'll call `pyplot.plot`. To learn about the myriad possibilities of Matplotlib, explore the [Gallery](http://matplotlib.org/gallery.html) of example plots.\n",
    "\n",
    "Here, we use the syntax for a simple 2D plot: `plot(x,y)`, where the `x` values are evenly distributed grid points:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBOR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v6qamhpdeeWVuWhqVsrLy1VeXh58f9lll+m8887Tv//7v+snP/lJDlvW/x5//HFdeOGFGj9+fMbjUb+Grli2bJmWLFmitWvXZoynqKioCP7/RRddpAkTJmjs2LFauXKlbrvttlw0NSvnnHOOzjnnnOD7yy67TB988IEefPBB/dd//VcOW9b/nnrqKQ0bNkwzZszIeDys13Du3LnauXNnTscg9ZY1ycjJJ5+s/Px8HTx4MOPxgwcPatSoUd0+Z9SoUUc93v/fbH7mQOnL+fnuv/9+3XvvvXrppZd00UUXHfXYM844QyeffLJ27979pducrS9zjr5BgwaprKwsaL8t17C1tVUrVqzoVceWy2uYrZ5+B4cOHarBgwf3y3siDFasWKE5c+Zo5cqVXeLwPzds2DCdffbZkbh+PRk/fnzQfluuoTFGTzzxhG6++WYVFhYe9dgwXMN58+bphRde0Msvv6wxY8Yc9dgw/C20phgpLCzU17/+dW3cuDF4LJlMauPGjRmfnNOVl5dnHC9JGzZsCI4fN26cRo0alXFMU1OTXn/99R5/5kDpy/lJR0ZA/+QnP9H69et16aWXHvN1PvzwQ3366acaPXp0v7Q7G309x3SdnZ166623gvbbcA2lI9PuEomEvv3tbx/zdXJ5DbN1rN/B/nhP5Nry5ct1yy23aPny5RlTsnvS0tKiDz74IBLXryd1dXVB+224htKRWSq7d+/u1QeCXF5DY4zmzZun1atXa9OmTRo3btwxnxOKv4X9Mgw2JFasWGFisZiprq4277zzjvnbv/1bM2zYMHPgwAFjjDE333yzufvuu4Pjt2zZYgoKCsz9999v3n33XbN48WIzaNAg89ZbbwXH3HvvvWbYsGFm7dq15n//93/Ntddea8aNG2c+//zz0J/fvffeawoLC82zzz5rGhoagq/m5mZjjDHNzc3mRz/6kdm6daupr683v/3tb80ll1xizjrrLNPW1nbcz68v57hkyRLz4osvmg8++MBs377d3HDDDSYej5u33347OCbK19D3V3/1V2bmzJldHg/bNWxubjY7duwwO3bsMJLMz3/+c7Njxw7zhz/8wRhjzN13321uvvnm4Pg9e/aYE044wdx1113m3XffNUuXLjX5+flm/fr1wTHH+m8W5vN75plnTEFBgVm6dGnG7+Bnn30WHHPnnXeampoaU19fb7Zs2WKmTJliTj75ZPPxxx8f9/MzJvtzfPDBB82aNWvM+++/b9566y1zxx13mLy8PPPb3/42OCbK19D37W9/20yYMKHbnxmma/j973/fFBUVmZqamoz33KFDh4Jjwvi30KpixBhj/vVf/9WcdtppprCw0IwfP9689tprwb9dfvnlZvbs2RnHr1y50px99tmmsLDQnH/++eY3v/lNxr8nk0nzT//0T2bkyJEmFouZK6+80uzatet4nEq3sjm/sWPHGkldvhYvXmyMMebQoUPmqquuMqeccooZNGiQGTt2rPnud7+bkw4iXTbnOH/+/ODYkSNHmmuuuca8+eabGT8vytfQGGPee+89I8m89NJLXX5W2K6hP83zz7/8c5o9e7a5/PLLuzzn4osvNoWFheaMM84wTz75ZJefe7T/ZsdTtud3+eWXH/V4Y45MZR49erQpLCw0p556qpk5c6bZvXv38T2xNNme43333We++tWvmng8boYPH24mTZpkNm3a1OXnRvUaGnNkGuvgwYPNY4891u3PDNM17O7cJGX8XoXxb6H3ReMBAABywpoxIwAAIJooRgAAQE5RjAAAgJyiGAEAADlFMQIAAHKKYgQAAOQUxQgAAMgpihEAAJBTFCMAACCnKEYAAEBOUYwAAICcohgBAAA59f8B1n2rxMA2r00AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "pyplot.plot(numpy.linspace(0, 2, nx), u);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Why doesn't the hat function have perfectly straight sides? Think for a bit."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now it's time to implement the discretization of the convection equation using a finite-difference scheme.  \n",
    "\n",
    "For every element of our array `u`, we need to perform the operation $u_i^{n+1} = u_i^n - c \\frac{\\Delta t}{\\Delta x}(u_i^n-u_{i-1}^n)$\n",
    "\n",
    "We'll store the result in a new (temporary) array `un`, which will be the solution $u$ for the next time-step.  We will repeat this operation for as many time-steps as we specify and then we can see how far the wave has convected.  \n",
    "\n",
    "We first initialize our placeholder array `un` to hold the values we calculate for the $n+1$ timestep, using once again the NumPy function `ones()`.\n",
    "\n",
    "Then, we may think we have two iterative operations: one in space and one in time (we'll learn differently later), so we'll start by nesting one loop inside the other. Note the use of the nifty `range()` function. When we write: `for i in range(1,nx)` we will iterate through the `u` array, but we'll be skipping the first element (the zero-th element).  *Why?*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "un = numpy.ones(nx) #initialize a temporary array\n",
    "\n",
    "for n in range(nt):  #loop for values of n from 0 to nt, so it will run nt times\n",
    "    un = u.copy() ##copy the existing values of u into un\n",
    "    for i in range(1, nx): ## you can try commenting this line and...\n",
    "    #for i in range(nx): ## ... uncommenting this line and see what happens!\n",
    "        u[i] = un[i] - c * dt / dx * (un[i] - un[i-1])\n",
    "        \n",
    "        "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Note**—We will learn later that the code as written above is quite inefficient, and there are better ways to write this, Python-style. But let's carry on.\n",
    "\n",
    "Now let's try plotting our `u` array after advancing in time."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAEACAYAAABWLgY0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHLJJREFUeJzt3XuUVNWZxuHfh9wEFC9RFAXUKBIUB6IoCIMFMXIfLipI\nNBqMCWY0Q0YzGpPMyIxOIkk00aW5mFEczcJIuDZ3BC0RVIIXbFA0QUAIICpoECQDtHv+2IV2muqu\n6upTtatOvc9atazqOl31Wev0y67v7LOPOecQEZF4ahS6ABERyR+FvIhIjCnkRURiTCEvIhJjCnkR\nkRhTyIuIxFjGkDezk83sKTN7zcxWm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jCnkRkRhTyIuIxJhCXkQkxhTyIiIxppAXEYkxhbyI\nSIwp5EVEYuz/AYvongtzVccXAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7ff9ad6728d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "pyplot.plot(numpy.linspace(0, 2, nx), u);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "OK! So our hat function has definitely moved to the right, but it's no longer a hat.  **What's going on?**"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Learn More\n",
    "-----\n",
    "***"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For a more thorough explanation of the finite-difference method, including topics like the truncation error, order of convergence and other details, watch **Video Lessons 2 and 3** by Prof. Barba on YouTube."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2MBERISGBUYLxoaL2NCOEJjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY//AABEIAWgB4AMBIgACEQEDEQH/xAAaAAEAAwEBAQAAAAAAAAAAAAAAAQMEAgUG/8QAPRAAAgICAAMDCAcHBQEBAQAAAAECAwQREiExE0FRBRQiMjNhcbFyc4GRocHRI0JiY5Ky4RU0UvDxQ1MG/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAHBEBAQEAAwEBAQAAAAAAAAAAAAEREiExYQJB/9oADAMBAAIRAxEAPwD78AAAAABBIAAAAAAAAAAAAQSAAAAAAACAJAAAAAAAAAAAAAACAJBVC+M4TnFPgjvT/wCWvAivIhZbKtcpRSk0/B/+AXAquuVNf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AAAAAAAAAAAAAAAAAAAAAAAAAACCQABBIAAAD//2Q==\n",
      "text/html": [
       "\n",
       "        <iframe\n",
       "            width=\"400\"\n",
       "            height=\"300\"\n",
       "            src=\"https://www.youtube.com/embed/iz22_37mMkk\"\n",
       "            frameborder=\"0\"\n",
       "            allowfullscreen\n",
       "            \n",
       "        ></iframe>\n",
       "        "
      ],
      "text/plain": [
       "<IPython.lib.display.YouTubeVideo at 0x7f2c707f3ca0>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from IPython.display import YouTubeVideo\n",
    "YouTubeVideo('iz22_37mMkk')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2MBERISGBUYLxoaL2NCOEJjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY//AABEIAWgB4AMBIgACEQEDEQH/xAAaAAEAAwEBAQAAAAAAAAAAAAAAAQMEAgUG/8QAQxAAAgIBAwEEBwUFBgQHAQAAAAECAxEEEiExBRNBURQiMmFxgZFCUqGxwSMz0eHwFTRTYnOScoKDoiQ1Q0RUk/EG/8QAFwEBAQEBAAAAAAAAAAAAAAAAAAECA//EAB8RAQEBAAICAwEBAAAAAAAAAAABEQIhMUEDElEiE//aAAwDAQACEQMRAD8A+/AAAAAAQ2l1aGQJBzvis+svV689CVyBIAAgkEASCCFJNtJrK6ryA6BAAkEEgAQmmsp5AEgjOOoTUkmnlPxAkAiUlH2ml4cgSCABIIDaXVgSAQBIBAEggkAAQBIAAAEASCCQAAAAgkACABIAAAAAAAAAAAAAAAAAAg8L/wDm+19R2jdrqL6XjTXyhG7wkk+F8T3jiq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hVZajjrlNfqBeSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQCQAIJAEEgAAAB//Z\n",
      "text/html": [
       "\n",
       "        <iframe\n",
       "            width=\"400\"\n",
       "            height=\"300\"\n",
       "            src=\"https://www.youtube.com/embed/xq9YTcv-fQg\"\n",
       "            frameborder=\"0\"\n",
       "            allowfullscreen\n",
       "            \n",
       "        ></iframe>\n",
       "        "
      ],
      "text/plain": [
       "<IPython.lib.display.YouTubeVideo at 0x7f2c707f3be0>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "YouTubeVideo('xq9YTcv-fQg')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For a careful walk-through of the discretization of the linear convection equation with finite differences (and also the following steps, up to Step 4), watch **Video Lesson 4** by Prof. Barba on YouTube."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkz\nODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2MBERISGBUYLxoaL2NCOEJjY2NjY2NjY2Nj\nY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY//AABEIAWgB4AMBIgACEQED\nEQH/xAAaAAEAAwEBAQAAAAAAAAAAAAAAAQIDBAUG/8QAOBAAAgIBAwEFBgUDBAIDAAAAAAECAxEE\nEiExBRNBUXEUIjJhcoEjNJGhsRXB0UJS8PEz4SRik//EABYBAQEBAAAAAAAAAAAAAAAAAAABAv/E\nABcRAQEBAQAAAAAAAAAAAAAAAAABESH/2gAMAwEAAhEDEQA/APvwAAAK7knhtfqBYEEgAQM84AkE\nbl5r9SQAIbS8SHKKaTay+i8wLArGSl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xFbvdTzjzA0M/aK+/7nd7/AKft6mmDlnoYS7QhrN0lKCxtT4b6Zf2YHUAAJAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAJIJAAgk\nAAAB/9k=\n",
      "text/html": [
       "\n",
       "        <iframe\n",
       "            width=\"400\"\n",
       "            height=\"300\"\n",
       "            src=\"https://www.youtube.com/embed/y2WaK7_iMRI\"\n",
       "            frameborder=\"0\"\n",
       "            allowfullscreen\n",
       "        ></iframe>\n",
       "        "
      ],
      "text/plain": [
       "<IPython.lib.display.YouTubeVideo at 0x7ff9ad152b38>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "YouTubeVideo('y2WaK7_iMRI')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Last but not least"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Remember** to rewrite Step 1 as a fresh Python script or in *your own* Jupyter notebook and then experiment by changing the discretization parameters. Once you have done this, you will be ready for [Step 2](./02_Step_2.ipynb).\n",
    "\n",
    "\n",
    "***"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<link href='http://fonts.googleapis.com/css?family=Fenix' rel='stylesheet' type='text/css'>\n",
       "<link href='http://fonts.googleapis.com/css?family=Alegreya+Sans:100,300,400,500,700,800,900,100italic,300italic,400italic,500italic,700italic,800italic,900italic' rel='stylesheet' type='text/css'>\n",
       "<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro:300,400' rel='stylesheet' type='text/css'>\n",
       "<style>\n",
       "    @font-face {\n",
       "        font-family: \"Computer Modern\";\n",
       "        src: url('http://mirrors.ctan.org/fonts/cm-unicode/fonts/otf/cmunss.otf');\n",
       "    }\n",
       "    div.cell{\n",
       "        width:800px;\n",
       "        margin-left:16% !important;\n",
       "        margin-right:auto;\n",
       "    }\n",
       "    h1 {\n",
       "        font-family: 'Alegreya Sans', sans-serif;\n",
       "    }\n",
       "    h2 {\n",
       "        font-family: 'Fenix', serif;\n",
       "    }\n",
       "    h3{\n",
       "\t\tfont-family: 'Fenix', serif;\n",
       "        margin-top:12px;\n",
       "        margin-bottom: 3px;\n",
       "       }\n",
       "\th4{\n",
       "\t\tfont-family: 'Fenix', serif;\n",
       "       }\n",
       "    h5 {\n",
       "        font-family: 'Alegreya Sans', sans-serif;\n",
       "    }\t   \n",
       "    div.text_cell_render{\n",
       "        font-family: 'Alegreya Sans',Computer Modern, \"Helvetica Neue\", Arial, Helvetica, Geneva, sans-serif;\n",
       "        line-height: 135%;\n",
       "        font-size: 120%;\n",
       "        width:600px;\n",
       "        margin-left:auto;\n",
       "        margin-right:auto;\n",
       "    }\n",
       "    .CodeMirror{\n",
       "            font-family: \"Source Code Pro\";\n",
       "\t\t\tfont-size: 90%;\n",
       "    }\n",
       "/*    .prompt{\n",
       "        display: None;\n",
       "    }*/\n",
       "    .text_cell_render h1 {\n",
       "        font-weight: 200;\n",
       "        font-size: 50pt;\n",
       "\t\tline-height: 100%;\n",
       "        color:#CD2305;\n",
       "        margin-bottom: 0.5em;\n",
       "        margin-top: 0.5em;\n",
       "        display: block;\n",
       "    }\t\n",
       "    .text_cell_render h5 {\n",
       "        font-weight: 300;\n",
       "        font-size: 16pt;\n",
       "        color: #CD2305;\n",
       "        font-style: italic;\n",
       "        margin-bottom: .5em;\n",
       "        margin-top: 0.5em;\n",
       "        display: block;\n",
       "    }\n",
       "    \n",
       "    .warning{\n",
       "        color: rgb( 240, 20, 20 )\n",
       "        }  \n",
       "</style>\n",
       "<script>\n",
       "    MathJax.Hub.Config({\n",
       "                        TeX: {\n",
       "                           extensions: [\"AMSmath.js\"]\n",
       "                           },\n",
       "                tex2jax: {\n",
       "                    inlineMath: [ ['$','$'], [\"\\\\(\",\"\\\\)\"] ],\n",
       "                    displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ]\n",
       "                },\n",
       "                displayAlign: 'center', // Change this to 'center' to center equations.\n",
       "                \"HTML-CSS\": {\n",
       "                    styles: {'.MathJax_Display': {\"margin\": 4}}\n",
       "                }\n",
       "        });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from IPython.core.display import HTML\n",
    "def css_styling():\n",
    "    styles = open(\"../styles/custom.css\", \"r\").read()\n",
    "    return HTML(styles)\n",
    "css_styling()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> (The cell above executes the style for this notebook. We modified a style we found on the GitHub of [CamDavidsonPilon](https://github.com/CamDavidsonPilon), [@Cmrn_DP](https://twitter.com/cmrn_dp).)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
